package com.example.layoutlearning;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ScrollView;

public class MainActivity extends Activity implements OnClickListener, OnTouchListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ScrollView view = (ScrollView)findViewById(R.id.sclScreen);
        view.setOnTouchListener(this);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    public void actionSend(){
    	
    }

	@Override
	public void onClick(View arg0) {
	}


	@Override
	public boolean onTouch(View arg0, MotionEvent arg1) {
		HideInput(R.id.et_1);
		HideInput(R.id.et_2);
		HideInput(R.id.et_3);
		return false;
	}
    public void HideInput(int id){
    	InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(((EditText)findViewById(id)).getApplicationWindowToken(), 0);
		
    }
}
